package com.sq.universe.system.conf;

import com.sq.universe.system.listener.WebSocketServer;
import org.crazycake.shiro.RedisSessionDAO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

@Component
public class WebsocketConfig  implements ApplicationRunner {


    @Value("${nettty.port}")
    private Integer nettyPort;

    @Autowired
    private  RedisSessionDAO redisSessionDAO;

    @Override
    public void run(ApplicationArguments args) throws Exception {
        new WebSocketServer(nettyPort,redisSessionDAO).start();
    }
}
